package com.crawler.waf.utils;

/**
 * 
 * 
 * 通过反射获取类实例
 *
 */
public class ReflectUtil {
	
	private static ClassLoader loader = Thread.currentThread().getContextClassLoader();
	
	public static Object getClass(String className){
		Object object = null;
		try {
			Class<?> clazz = Class.forName(className,true, loader);
			try {
				object = clazz.newInstance();
			} catch (InstantiationException e) {
				e.printStackTrace();
			} catch (IllegalAccessException e) {
				e.printStackTrace();
			}
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
		return object;
	}
}
